<!DOCTYPE html>
<html>
<head>
    <title>督察专项</title>
    <#include "/header.html">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/dczx.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/index.css">
</head>
<body>
<div id="rrapp">
    <div class="content">
        <h3 class="content-title clearfix" v-cloak v-if="!isList">
            {{pageTitle}}
            <i class="el-icon-back pull-right" @click.stop="cancel"></i>
        </h3>
        <!--专项数据表格-->
        <div class="content-box clearfix" v-cloak v-if="isList">
            <div class="top-form-box clearfix">
                <el-button round size="small" @click="handleClick(0)" :type="onAll">全部项目</el-button>
                <el-button round size="small" v-if="dclx" @click="handleClick(1)" :type="onLx">督察立项</el-button>
                <el-button round size="small" v-if="dcsp" @click="handleClick(2)" :type="onSp">专项审批</el-button>
                <div class="input-box pull-right clearfix">
                    <el-input class="pull-left" placeholder="请输入内容" v-model="findKey" @keyup.enter="search" clearable
                              size="small" style="width: 200px;margin-right: 10px"></el-input>
                    <el-button class="pull-left" type="primary" round size="small" @click="search">查询</el-button>
                    <div class="tpl-type-add pull-left" v-if="xz">
                        <span class="add-pro" @click.stop="addProject"><i class="fa fa-plus"></i></span>
                    </div>
                </div>
            </div>
            <el-table :data="tableData" border>
                      <!--:filter-change="handleFilterChange"-->
                <el-table-column
                        type="index"
                        :index="indexMethod"
                        width="50">
                </el-table-column>
                <el-table-column prop="titleName" align="center" label="标题">
                </el-table-column>
                <el-table-column prop="userDeptName" align="center" label="立项单位">
                </el-table-column>
                <el-table-column prop="lxrq" sortable label="立项时间" width="110px">


                </el-table-column>
                <!--<el-table-column prop="startTime" label="开始时间" :formatter="formatTime" width="150px">
                </el-table-column>
                <el-table-column prop="jzrq" label="截至时间" :formatter="formatTime1" width="150px">
                </el-table-column>-->
                <el-table-column
                    prop="lxspzt"
                    label="项目状态"
                    align="center"
                    v-if="!isSh"
                    :formatter="formatStatus"
                    :filters="[{ text: '立项中', value: '0' }, { text: '立项已驳回', value: '1' }, { text: '未开始', value: '21' }, { text: '进行中', value: '22' }, { text: '已截止', value: '23' }, { text: '办结中', value: '3' }, { text: '办结已驳回', value: '4' }, { text: '已办结', value: '5' }]"
                    :filter-method="filterProjectStatus"
                    :filter-multiple=false
                    width="120px">
                </el-table-column>
                <el-table-column
                    prop="lxspzt"
                    label="项目状态"
                    align="center"
                    v-if="isSh"
                    :formatter="formatStatus"
                    :filters="[{ text: '立项中', value: '0' }, { text: '办结中', value: '3' }]"
                    :filter-method="filterProjectStatus"
                    :filter-multiple=false
                    width="120px">
                </el-table-column>

                <el-table-column
                    prop="dcnum"
                    align="right"
                    header-align="center"
                    label="单位执行个数"
                    :formatter="formatMath"
                    width="180px">
                    <template slot-scope="scope">
                        <el-progress color="#409EFF"  :text-inside="true" :stroke-width="18" :percentage='scope.row.allnum == 0 ? "0" : Math.round(scope.row.dcnum / scope.row.allnum * 10000) / 100.00' status="success"></el-progress>
                    </template>
                </el-table-column>
                <el-table-column label="操作">
                    <template slot-scope="scope">
                        <el-button size="mini" type="success" plain @click="operationClick(3,scope.row.id)"
                                   v-if="scope.row.projectStatus === '0' && scope.row.lxspzt === '0' && RegExp(/A/).test(scope.row.role)">
                            通过立项
                        </el-button>
                        <el-button size="mini" type="success" plain @click="bhClick(4,scope.row.id)"
                                   v-if="scope.row.projectStatus === '0' && scope.row.lxspzt === '0' && RegExp(/A/).test(scope.row.role)">
                            驳回立项
                        </el-button>
                        <el-button size="mini" type="warning" plain @click="operationClick(2,scope.row.id)"
                                   v-if="scope.row.projectStatus === '0' && scope.row.lxspzt === '0' && RegExp(/B/).test(scope.row.role)">
                            取消立项
                        </el-button>
                        <el-button size="mini" type="success" plain @click="operationClick(1,scope.row.id)"
                                   v-if="scope.row.projectStatus === '0' && scope.row.lxspzt === '1' && RegExp(/B/).test(scope.row.role)">
                            再次立项
                        </el-button>
                        <el-button size="mini" type="primary" plain @click="operationClick(5,scope.row.id)"
                                   v-if='scope.row.projectStatus === "1" && (scope.row.lxspzt === "2" || scope.row.lxspzt === "4") && RegExp("\""+scope.row.dqdw+"\"").test(scope.row.projectJsonInfo) && (Date.parse(new Date()) > scope.row.startTime)'>
                            执行督察
                        </el-button>
                        <el-button size="mini" type="primary" plain @click="operationClick(6,scope.row.id)"
                                   v-if="scope.row.projectStatus === '1' && (scope.row.lxspzt === '2' || scope.row.lxspzt === '4') && RegExp(/B/).test(scope.row.role) && (Date.parse(new Date()) > scope.row.jzrq)">
                            申请办结
                        </el-button>
                        <el-button size="mini" type="primary" plain @click="operationClick(7,scope.row.id)"
                                   v-if="scope.row.projectStatus === '2' && scope.row.lxspzt === '3' && RegExp(/B/).test(scope.row.role) && (Date.parse(new Date()) > scope.row.jzrq)">
                            取消办结
                        </el-button>
                        <el-button size="mini" type="success" plain @click="operationClick(8,scope.row.id)"
                                   v-if="scope.row.projectStatus === '2' && scope.row.lxspzt === '3' && RegExp(/A/).test(scope.row.role)">
                            通过办结
                        </el-button>
                        <el-button size="mini" type="success" plain @click="bhClick(9,scope.row.id)"
                                   v-if="scope.row.projectStatus === '2' && scope.row.lxspzt === '3' && RegExp(/A/).test(scope.row.role)">
                            驳回办结
                        </el-button>
                        <!-- <el-button size="mini" @click="handleClick(null)" disabled v-if="scope.row.projectStatus === '3'">已审批</el-button> -->
                        <el-button size="mini" @click="handleView(scope.$index, scope.row)">查看</el-button>
                        <!--<el-button size="mini" @click="download(scope.$index, scope.row)">下载</el-button>-->
                    </template>
                </el-table-column>
            </el-table>
            <div class="pagination-box pull-right">
                <el-pagination background layout="prev, pager, next" :page-size="pageSize" :current-page.sync="pageNo"
                               :page-count="totalPage" @current-change="pageChange"></el-pagination>
            </div>
        </div>
        <!--专项数据详情-->
        <div class="content-box clearfix" v-cloak v-if="isDetail">
            <div class="item-title-row">
                <div class="detail-box clearfix">
                    <div class="tpl-info pull-left clearfix">
                        <span class="tpl-icon pull-left"><img src=""></span>
                        <p class="tpl-infos pull-left">
                            <span class="tpl-title">{{lookTitle}}</span>
                            <span class="tpl-arg">
                                <span>{{lookCorp}}</span>
                                <span>{{lookUpdateTime}}</span>
                                <span>{{lookStatus}}</span>
                                <span class="status">{{lookPercent}}</span>
                                <el-tag v-if="lookDclx == 1" color="#0033ff" size="mini">常规</el-tag>
                                <el-tag v-if="lookDclx == 2" color="#f7e84a" size="mini">联合</el-tag>
                                <el-tag v-if="lookDclx == 3" color="rgb(226, 53, 26)" size="mini">自查</el-tag>
                                <el-tag v-if="lookDcssfs" size="mini">暗访</el-tag>
                        </el-button>
                            </span>
                            </br>
                            <span class="tpl-arg">
                                <span>开始自</span>
                                <span>{{lookStartTime}}</span>
                                <span>截止于</span>
                                <span>{{lookJzrq}}</span>
                            </span>
                        </p>
                    </div>
                    <div class="tpl-status-btn pull-right">
                        <el-button v-if="downloadButton" type="primary" size="small" icon="el-icon-download" @click="download()">附件
                        </el-button>
                        <el-button v-if="executeButton" type="primary" size="small" icon="el-icon-edit-outline" @click="operationClick(5,-1)">执行
                        </el-button>
                    </div>
                </div>
            </div>
            <div class="item-info-row">
                <p class="row-title">督察说明</p>
                <p class="item-info">
                    {{itemInfos}}
                </p>
            </div>
            <div class="item-tpl-row">
                <el-tabs v-model="tabName" @tab-click="TabHandleClick">
                    <el-tab-pane label="项目进程" name="1"></el-tab-pane>
                    <el-tab-pane label="执行单位" name="2"></el-tab-pane>
                    <el-tab-pane label="督察记录" name="3"></el-tab-pane>
                    <el-tab-pane label="督察模板" name="4"></el-tab-pane>
                </el-tabs>
                <div class="item-tpl-box">
                    <ul class="history-list">
                        <li class="history-item" @click="alertMsg(item)" v-for="(item,index) in historyData" :key="item.id">
                            <span v-if="tabName == 3" class="item-icon"><i class="el-icon-time"></i></span>
                            <span v-if="tabName == 3" class="item-name">{{item.name}}-{{lookTitle}}</span>
                            <span v-if="tabName == 3" class="item-number">{{item.dcwts}}问题</span>
                            <span v-if="tabName == 3" class="item-time">{{item.dcsj}}</span>

                            <span v-if="tabName == 3" class="item-view"><el-button type="text" size="medium"
                                                                                   @click="handleViewHistory(item.id)">查看</el-button></span>
                            <span v-if="tabName == 1" class="item-icon"><i class="el-icon-check"></i></span>
                            <span v-if="tabName == 1" class="item-time">{{item.createTime}}</span>
                            <span v-if="tabName == 1" class="item-dept">{{item.deptName}}</span>
                            <span v-if="tabName == 1" class="item-user">{{item.czryName}}</span>
                            <span v-if="tabName == 1" class="item-status">{{item.czzt}}</span>
                            <span v-if="tabName == 1 && historyDataSize > (index +1)" style="width:100%"></br></span>
                            <span v-if="tabName == 2 && item.ssStatus == 0" class="item-icon"><i class="el-icon-remove-outline"></i></span>
                            <span v-if="tabName == 2 && item.ssStatus == 1" class="item-yicon"><i class="el-icon-circle-check"></i></span>
                            <span v-if="tabName == 2" class="item-title">{{item.deptName}}</span>
                            <span v-if="tabName == 2" class="item-time">{{item.ssTime}}</span>
                            <span v-if="tabName == 2" class="item-status">{{item.statusName}}</span>
                        </li>
                    </ul>

                    <h3 v-if="tabName == 4" class="project-tpl-title">{{modelName}}</h3>
                    <el-tree v-if="tabName == 4"
                            :data="modelList"
                            :props="props"
                            node-key="id"
                            ref="projectTplTree"
                            empty-text="暂无模板"
                            highlight-current
                            style="height: 300px"
                            :default-expanded-keys="modelViewExpandedKeys"
                    >
                    </el-tree>
                </div>
            </div>
            <!--<div class="item-history-row">
               <el-tabs v-model="tabName" @tab-click="TabHandleClick">
                    <el-tab-pane label="项目进程" name="1"></el-tab-pane>
                    <el-tab-pane label="执行单位" name="2"></el-tab-pane>
                    <el-tab-pane label="督察记录" name="3"></el-tab-pane>
                </el-tabs>
                <div class="history-box">
                    <ul class="history-list">
                        <li class="history-item" @click="alertMsg(item)" v-for="item in historyData" :key="item.id">
                            <span v-if="tabName == 3" class="item-icon"><i class="el-icon-time"></i></span>
                            <span v-if="tabName == 3" class="item-name">{{item.name}}-{{lookTitle}}</span>
                            <span v-if="tabName == 3" class="item-number">{{item.dcwts}}问题</span>
                            <span v-if="tabName == 3" class="item-time">{{item.dcsj}}</span>

                            <span v-if="tabName == 3" class="item-view"><el-button type="text" size="medium"
                                                               @click="handleViewHistory(item.id)">查看</el-button></span>
                            <span v-if="tabName == 1" class="item-icon"><i class="el-icon-time"></i></span>
                            <span v-if="tabName == 1" class="item-time">{{item.createTime}}</span>
                            <span v-if="tabName == 1" class="item-dept">{{item.deptName}}</span>
                            <span v-if="tabName == 1" class="item-user">{{item.czryName}}</span>
                            <span v-if="tabName == 1" class="item-status">{{item.czzt}}</span>
                            <span v-if="tabName == 1" style="width:100%"><i class="el-icon-time"></i></span>
                            <span v-if="tabName == 2 && item.ssStatus == 0" class="item-icon"><i class="el-icon-remove-outline"></i></span>
                            <span v-if="tabName == 2 && item.ssStatus == 1" class="item-yicon"><i class="el-icon-circle-check"></i></span>
                            <span v-if="tabName == 2" class="item-title">{{item.deptName}}</span>
                            <span v-if="tabName == 2" class="item-time">{{item.ssTime}}</span>
                            <span v-if="tabName == 2" class="item-status">{{item.statusName}}</span>
                        </li>
                    </ul>
                </div>
            </div>-->
        </div>
        <!--新增督察专项-->
        <div class="content-box clearfix" v-cloak v-show="isAdd">
            <!--立项基本-->
            <div class="content-left" v-show="createSteps === 0">
                <el-form label-width="80px" class="clearfix" ref="baseForm" :model="baseForm">
                    <template>
                        <el-form-item label="标题">
                            <el-input v-model="baseForm.titleName" class="title" @blur="checkLength()"></el-input>
                            <el-radio class="is-message" v-model="baseForm.msgFlag" :label="0"
                                      @click.native.prevent="changeMessage(0)">短信通知
                            </el-radio>
                        </el-form-item>
                    </template>
                    <el-form-item label="督察描述">
                        <el-input type="textarea" v-model="baseForm.description"></el-input>
                    </el-form-item>
                    <el-form-item label="主办单位">
                        <el-input v-model="baseForm.zbdw" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="是否暗访">
                        <el-radio class="is-message" v-model="baseForm.dcssfs" :label="1"
                                  @click.native.prevent="changeAf(1)">暗访
                        </el-radio>
                    </el-form-item>
                    <el-form-item label="立项类型">
                        <el-radio class="is-message" v-model="baseForm.dclx" :label="1"
                                  @click.native.prevent="changeLxlx(1)">常规专项
                        </el-radio>
                        <el-radio class="is-message" v-model="baseForm.dclx" :label="2"
                                  @click.native.prevent="changeLxlx(2)">联合督察
                        </el-radio>
                        <el-radio class="is-message" v-model="baseForm.dclx" :label="3"
                                  @click.native.prevent="changeLxlx(3)">自查专项
                        </el-radio>
                    </el-form-item>
                    <el-form-item label="执行单位">
                        <template>
                            <div class="dw-list-box clearfix">
                                <div class="dw-type-list" v-if="dwqf">
                                    <el-radio-group v-model="dwType" @change="changeDwType(dwType)">
                                        <el-radio :label="0">条线单位</el-radio>
                                        <el-radio :label="1">非条线单位</el-radio>
                                    </el-radio-group>
                                    <!--<el-radio class="is-message" v-model="dwType" :label="0" @click.native.prevent="changeDwType(0)">条线单位</el-radio>
                                    <el-radio class="is-message" v-model="dwType" :label="1" @click.native.prevent="changeDwType(1)">非条线单位</el-radio>
-->
                                </div>
                                <div v-show="dwType === 0">
                                    <div class="dw-view-list">
                                        <h5 class="tpl-view-title">单位列表</h5>
                                        <el-tree
                                                :data="ssfwtxList"
                                                :props="props"
                                                show-checkbox
                                                node-key="deptid"
                                                @check="handleCheckChange"
                                                ref="ssfwTxTree"
                                                empty-text="暂无单位"
                                                default-expand-all

                                        >
                                        </el-tree>
                                    </div>

                                </div>
                                <div v-show="dwType === 1">
                                    <div class="dw-view-list">
                                        <h5 class="tpl-view-title">单位列表</h5>
                                        <el-tree
                                                :data="ssfwList"
                                                :props="props"
                                                show-checkbox
                                                node-key="deptId"
                                                @check="handleCheckChange"
                                                ref="ssfwTree"
                                                empty-text="暂无单位"
                                                default-expand-all

                                        >
                                        </el-tree>
                                    </div>
                                </div>
                                <div class="dw-checked-list">
                                    <h5 class="tpl-view-title">已选单位</h5>
                                    <el-tree
                                            :data="baseForm.ssfwCheckedList"
                                            :props="props"
                                            node-key="deptId"
                                            ref="checkedTree"
                                            empty-text="暂无选中单位"
                                    >
                                    </el-tree>
                                </div>
                            </div>
                        </template>
                    </el-form-item>
                    <div class="el-form-item">
                        <label class="el-form-item__label" style="width: 80px;">专项文档</label>
                        <div class="el-form-item__content" style="margin-left: 80px;">
                            <div class="el-textarea">
                                <input type="text" placeholder="请上传doc格式文档" class="el-input__inner" id="fileText" style="width: 41%;float: left;"
                                       readonly="readonly" disabled="disabled"/>

                                <button style="height: 40px;margin-left:-2px;float: left "  type="button" >
                                    <label for="fileZxwd" style="color: #444445">  选择文件  </label>
                                </button>

                                <input type="file" id="fileZxwd" accept=".doc,.docx"  @change="selectTheFile(this)" style="display: none"/>
                            </div>
                        </div>

                    </div>
                    <el-form-item label="开始时间">
                        <el-date-picker
                                v-model="baseForm.startTimeDate"
                                type="datetime"
                                placeholder="选择开始时间"
                                :picker-options="pickerOptions0"
                        >
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="截止时间">
                        <el-date-picker
                                v-model="baseForm.jzrqDate"
                                type="datetime"
                                :picker-options="pickerOptions1"
                                placeholder="选择截止时间"
                        >
                        </el-date-picker>
                    </el-form-item>
                    <!--<el-form-item label="立项文件">
                        <el-input v-model="baseForm.fileName" disabled></el-input>
                    </el-form-item>-->
                </el-form>
            </div>
            <!--模版选择-->
            <div class="content-left clearfix" v-show="createSteps === 1">
                <div class="tpl-left">
                    <h5 class="tpl-view-title">模板列表</h5>
                    <el-tree
                            :data="tplList"
                            :props="props"
                            node-key="id"
                            ref="tplTree"
                            @node-click="handleChooseTpl"
                            empty-text="暂无模板"
                            highlight-current
                            style="height: 300px"
                    >
                    </el-tree>
                </div>
                <div class="tpl-right">
                    <h5 class="tpl-view-title">模板预览</h5>
                    <el-tree
                            :data="tplViewList"
                            :props="props"
                            node-key="id"
                            ref="tplViewTree"
                            empty-text="暂未选中模板"
                            style="height: 500px"
                    >
                    </el-tree>
                </div>
            </div>
            <!--步骤条-->
            <div class="content-right">
                <div class="steps">
                    <el-steps direction="vertical" :active="createSteps" finish-status="wait" process-status="finish">
                        <el-step title="立项基本"></el-step>
                        <el-step title="模板选择"></el-step>
                        <el-step title="提交审核"></el-step>
                    </el-steps>
                </div>
            </div>
        </div>
        <div class="content-btn-box" v-cloak v-if="isAdd">
            <el-button plain size="medium" @click.stop="cancel">&nbsp;&nbsp;取消&nbsp;&nbsp;</el-button>
            <el-button type="primary" size="medium" @click.stop="nextStep" v-if="createSteps === 0">下一步</el-button>
            <el-button type="primary" size="medium" @click.stop="commit" v-if="createSteps === 1">提交审批</el-button>
        </div>
    </div>

</div>
<script src="${request.contextPath}/statics/plugins/element/index.js"></script>
<script src="${request.contextPath}/statics/js/modules/business/dczx.js?_${.now?long}"></script>
</body>
</html>